import {CHANGE_BANNER_ACTION, CHANGE_RECOMMEND_ACTION} from "./constants";

const initialState = {
    banner: [],
    recommend: [],
}

function reducer(state = initialState, action) {
    switch (action.type) {
        case CHANGE_BANNER_ACTION:
            return {...state, banner: state.banner.concat(action.banner)}
        case CHANGE_RECOMMEND_ACTION:
            return {...state, recommend: state.recommend.concat(action.recommend)}
        default:
            return state;
    }
}

export default reducer;